package com.zhiyou100.service;

import com.zhiyou100.dao.StudentDao;
import com.zhiyou100.entity.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yang
 * @className StudentServiceImp
 * @packageName com.zhiyou100.service
 * @Description TODO 学生服务层 实现类
 * @date 2020-08-22 14:59
 *
 * // @Service 表明是一个服务层，注册一个 bean
 */

@Service
public class StudentServiceImpl implements StudentService {


    private StudentDao studentDao;

    @Autowired
    public void setStudentDao(StudentDao studentDao) {
        this.studentDao = studentDao;
    }

    @Override
    public List<Student> getAll() {
        return studentDao.getAll();
    }

    @Override
    public Student getOneBySid(Integer sid) {
        return studentDao.getOneBySid(sid);
    }

    @Override
    public void delOneBySid(Integer sid) {
        studentDao.delOneBySid(sid);
    }

    @Override
    public void addOne(Student student) {
        studentDao.addOne(student);
    }

    @Override
    public void updateOne(Student student) {
        studentDao.updateOne(student);
    }
}
